<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">

<h:head>
</h:head>

<h:body>

	<ui:composition template="/commonLayout.xhtml">
		<ui:define name="content">
			<h:form id="form">
			<p:messages autoUpdate="true" id="messages" showDetail="true"/> 
				<table>
					<tr>
						<td><h:selectOneListbox id="selectionMatiere"
								styleClass="cours" valueChangeListener="#{lecons.afficherListeCours}" onchange="submit()">
								<f:selectItems value="#{lecons.matiere}" var="m" itemLabel="#{m.nom}" itemValue="#{m.idMatiere}" />
							</h:selectOneListbox></td>

						<td><p:tree styleClass="cours" value="#{lecons.listeCours}"
								var="node" id="tree" dynamic="true" cache="false" selectionMode="single">
								<p:ajax event="select" listener="#{lecons.telechargerDoc}" update=":form:tree"/>
								<p:treeNode id="treeNode">
									<h:outputText value="#{node.nom}" id="lblNode" />
								</p:treeNode>
								
							</p:tree></td>
					</tr>
				</table>
			</h:form>
		</ui:define>
	</ui:composition>

</h:body>
</html>